home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / lang / ProcessImpl.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.8 KB  |  118 lines

  1. package java.lang;
  2.  
  3. import java.io.File;
  4. import java.io.FileDescriptor;
  5. import java.io.IOException;
  6. import java.io.InputStream;
  7. import java.io.OutputStream;
  8. import java.security.AccessController;
  9. import java.util.Map;
  10.  
  11. final class ProcessImpl extends Process {
  12.    private long handle = 0L;
  13.    private FileDescriptor stdin_fd;
  14.    private FileDescriptor stdout_fd;
  15.    private FileDescriptor stderr_fd;
  16.    private OutputStream stdin_stream;
  17.    private InputStream stdout_stream;
  18.    private InputStream stderr_stream;
  19.  
  20.    static Process start(String[] var0, Map<String, String> var1, String var2, boolean var3) throws IOException {
  21.       String var4 = ProcessEnvironment.toEnvironmentBlock(var1);
  22.       return new ProcessImpl(var0, var4, var2, var3);
  23.    }
  24.  
  25.    private ProcessImpl(String[] var1, String var2, String var3, boolean var4) throws IOException {
  26.       var1[0] = (new File(var1[0])).getPath();
  27.       StringBuilder var5 = new StringBuilder(80);
  28.  
  29.       for(int var6 = 0; var6 < var1.length; ++var6) {
  30.          if (var6 > 0) {
  31.             var5.append(' ');
  32.          }
  33.  
  34.          String var7 = var1[var6];
  35.          if (var7.indexOf(32) < 0 && var7.indexOf(9) < 0) {
  36.             var5.append(var7);
  37.          } else if (var7.charAt(0) != '"') {
  38.             var5.append('"');
  39.             var5.append(var7);
  40.             if (var7.endsWith("\\")) {
  41.                var5.append("\\");
  42.             }
  43.  
  44.             var5.append('"');
  45.          } else {
  46.             if (!var7.endsWith("\"")) {
  47.                throw new IllegalArgumentException();
  48.             }
  49.  
  50.             var5.append(var7);
  51.          }
  52.       }
  53.  
  54.       String var8 = var5.toString();
  55.       this.stdin_fd = new FileDescriptor();
  56.       this.stdout_fd = new FileDescriptor();
  57.       this.stderr_fd = new FileDescriptor();
  58.       this.handle = this.create(var8, var2, var3, var4, this.stdin_fd, this.stdout_fd, this.stderr_fd);
  59.       AccessController.doPrivileged(new 1(this));
  60.    }
  61.  
  62.    public OutputStream getOutputStream() {
  63.       return this.stdin_stream;
  64.    }
  65.  
  66.    public InputStream getInputStream() {
  67.       return this.stdout_stream;
  68.    }
  69.  
  70.    public InputStream getErrorStream() {
  71.       return this.stderr_stream;
  72.    }
  73.  
  74.    public void finalize() {
  75.       this.close();
  76.    }
  77.  
  78.    public native int exitValue();
  79.  
  80.    public native int waitFor();
  81.  
  82.    public native void destroy();
  83.  
  84.    private native long create(String var1, String var2, String var3, boolean var4, FileDescriptor var5, FileDescriptor var6, FileDescriptor var7) throws IOException;
  85.  
  86.    private native void close();
  87.  
  88.    // $FF: synthetic method
  89.    static OutputStream access$002(ProcessImpl var0, OutputStream var1) {
  90.       return var0.stdin_stream = var1;
  91.    }
  92.  
  93.    // $FF: synthetic method
  94.    static FileDescriptor access$100(ProcessImpl var0) {
  95.       return var0.stdin_fd;
  96.    }
  97.  
  98.    // $FF: synthetic method
  99.    static InputStream access$202(ProcessImpl var0, InputStream var1) {
  100.       return var0.stdout_stream = var1;
  101.    }
  102.  
  103.    // $FF: synthetic method
  104.    static FileDescriptor access$300(ProcessImpl var0) {
  105.       return var0.stdout_fd;
  106.    }
  107.  
  108.    // $FF: synthetic method
  109.    static InputStream access$402(ProcessImpl var0, InputStream var1) {
  110.       return var0.stderr_stream = var1;
  111.    }
  112.  
  113.    // $FF: synthetic method
  114.    static FileDescriptor access$500(ProcessImpl var0) {
  115.       return var0.stderr_fd;
  116.    }
  117. }
  118.